let user = require('../../db/hospitaldb')



module.exports=async(req,resp)=>{
  
    // await
    // console.log(req.body);
     let lengt=await user.find().count();
    let obj={
          id: String(lengt+1001),
        hospitallistName:req.body.uname,
        grade:req.body.dengji,
        address:req.body.addressxx,
        jwd:req.body.jwd
    }
    await user.create(obj).then((data)=>{
        if(!data){
            resp.status(500).send('添加失败')
        }else{
            resp.redirect('/index/discussion')
        }
    })
   
}